<?php
include_once($_SERVER['DOCUMENT_ROOT']."/config.php");
include_once($gDOCUMENT_ROOT_SYSTEM.'include/dao/film_release_on_blu_ray.php');
class filmReleaseOnBluRayAction
{
	private $film;
	private $film_release_on_blu_ray;
	private $film_rating;
	function __construct()
	{
		$this->film = new film();
		$this->film_release_on_blu_ray = new film_release_on_blu_ray();
	}
	public function AddFilmRelease($data)
	{
		try
		{
			if(!isset($data['date']))
			{
				$data['date'] = intval($data['date_year']).'-'.intval($data['date_month']).'-'.intval($data['date_day']);
			}
			if(!isset($data['runtime']))
			{
				$data['runtime'] = intval($data['runtime_hour'])*3600 + intval($data['runtime_minute'])*60 + intval($data['runtime_second']);
			}
			$film_id = $this->film_release_on_blu_ray->insert($data);
		}
		catch(Exception $e)
		{
			//echo 'Message: ' .$e->getMessage();
			return false;
		}
	}
	
	public function getFilmReleaseByFilmId($film_id,$column='*')
	{
		try
		{
			$blu_ray = $this->film_release_on_blu_ray->getByFilmId($film_id,$column);
			return $blu_ray;
		}
		catch(Exception $e)
		{
			//echo 'Message: ' .$e->getMessage();
			return false;
		}
	}
}

?>
